package com.wander.designCreational.abstractfactory.client;

import com.wander.designCreational.abstractfactory.factory.AppleFactoryImpl;
import com.wander.designCreational.abstractfactory.factory.Factory;
import com.wander.designCreational.abstractfactory.factory.RedmiFactoryImpl;
import com.wander.designCreational.abstractfactory.product.Charger;
import com.wander.designCreational.abstractfactory.product.Phone;
import org.junit.jupiter.api.Test;

/**
 * @Author : WDYin
 * @Date : 2020/5/8
 * @Description :
 */
public class Client {

    @Test
    public void test1() {

        Factory appleFactory = new AppleFactoryImpl();
        Phone applePhone = appleFactory.getPhone();
        Charger appleCharger = appleFactory.getCharger();
        System.out.println(appleFactory);
        applePhone.produce();
        appleCharger.produce();

        Factory redmiFactory = new RedmiFactoryImpl();
        Phone redmiPhone = redmiFactory.getPhone();
        Charger redmiCharger = redmiFactory.getCharger();
        System.out.println(redmiFactory);
        redmiPhone.produce();
        redmiCharger.produce();


    }
}
